from pywinauto.application import Application
app = Application(backend='uia').start('notepad.exe')

# 描述进程内的窗口
dlg_spec = app.UntitleNotepad
# 等待窗口完全打开
a_dlg = dlg_spec.wait('visible')

from subprocess import Popen
from pywinauto import Desktop
Popen('calc.exe', shell=True)
dlg = Desktop(backend='uia').Calculator
dlg.wait('visible')

